import { defineComponent, ref } from 'vue';
import './example-tsx.scss';
import { resource } from '../../global';

export default defineComponent({
  name: 'ExampleTsx',
  setup() {
    const img = resource.dir('assets/svg/ibiz-logo.svg');

    const count = ref(0);

    const click = () => {
      count.value += 1;
    };

    return { img, count, click };
  },
  render() {
    return (
      <div class='example-tsx'>
        <img src={this.img} />
        <button onClick={this.click}>计数: {this.count}</button>
      </div>
    );
  },
});
